Skip to content

fix(config): allow vertex keys without base-url#2116

Merged
luispater merged 1 commit intodevfrom
vertex
Mar 14, 2026
Merged

fix(config): allow vertex keys without base-url#2116
luispater merged 1 commit intodevfrom
vertex

Conversation

@hkfires
Copy link
Collaborator

@hkfires hkfires commented Mar 13, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the flexibility of Vertex API key configuration by making the base-url field optional. This change allows users to define Vertex-compatible API keys that will automatically fall back to the default Google Vertex API when no specific base-url is provided. Concurrently, it introduces a validation step to ensure that all configured Vertex API keys always include a valid api-key.

Highlights

  • Vertex base-url made optional: The base-url field for Vertex API keys is no longer mandatory, allowing configurations to default to Google Vertex when omitted.
  • API Key validation added: A new check ensures that an api-key is always provided for Vertex-compatible key configurations.
  • Configuration sanitization updated: The logic for sanitizing Vertex-compatible API keys was adjusted to accommodate the optional base-url.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • config.example.yaml
    • Clarified in comments that base-url is now optional for Vertex API keys.
  • internal/api/handlers/management/config_lists.go
    • Implemented a check to ensure that each Vertex-compatible API key entry has a non-empty api-key.
  • internal/config/config.go
    • Updated the comment describing the sanitization process for Vertex-compatible API keys.
  • internal/config/vertex_compat.go
    • Modified the BaseURL field's documentation to reflect its optional status and explain the fallback mechanism.
    • Removed the code that previously enforced BaseURL as a required field during sanitization.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request makes base-url optional for Vertex API keys, allowing them to fall back to the default Google Vertex endpoint. The core logic change is in SanitizeVertexCompatKeys where the check for an empty base-url is removed. While this is correct, it creates an inconsistency with the PatchVertexCompatKey handler, which I've commented on. Please address this to ensure the feature works as expected through the management API.

I am having trouble creating individual review comments. Click here to see my feedback.

internal/config/vertex_compat.go (74-77)

high

While this change correctly removes the requirement for base-url during sanitization, it introduces an inconsistency with the PatchVertexCompatKey handler in internal/api/handlers/management/config_lists.go. That handler still treats an empty base-url as a reason to delete the entire key entry, which will prevent users from making the base-url optional on existing keys via the management API. This should be fixed to align with the new behavior.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 560c020477

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@@ -71,10 +71,6 @@ func (cfg *Config) SanitizeVertexCompatKeys() {
}
entry.Prefix = normalizeModelPrefix(entry.Prefix)
entry.BaseURL = strings.TrimSpace(entry.BaseURL)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow PATCH to clear Vertex base-url without deletion

SanitizeVertexCompatKeys now treats empty base-url as valid, so keys can intentionally fall back to Google Vertex, but PatchVertexCompatKey still treats an empty base-url as a delete operation (internal/api/handlers/management/config_lists.go:574-580). This makes the new behavior inconsistent across management APIs: a user trying to migrate an existing key to the default endpoint via PATCH will silently remove the credential instead of updating it, causing avoidable auth/routing breakage until the key is re-added.

Useful? React with 👍 / 👎.

@luispater luispater merged commit 77254bd into dev Mar 14, 2026
2 checks passed
@luispater luispater deleted the vertex branch March 14, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants